﻿using System.Collections.Generic;
using System;
using System.Data;
namespace WPFExcelReport
{
    public partial class VAMEINST
    {
        private VAMMODUL _VAMD;
        public VAMMODUL VAMD
        {
            get
            {
                if (_VAMD == null) _VAMD = new VAMMODUL();
                return _VAMD;
            }
        }
        public void NAMEINST(Dictionary<string, object> pm)
        {
            dwData = TBMain.NewRow();
            SetUpNewRow(ref dwData);
            dwData["AMEMANDANT"] = app.Mandant;
            dwData["AMENRKRS"] = (string)pm["NRKRS"];
            dwData["AMELFDNR"] = (string)pm["LFDNR"];
            dwData["AMEPOS"] = (string)pm["POS"];
            dwData["AMEMESCHL"] = (string)pm["MESCHL"];
            dwData["AMEMODNR"] = (string)pm["MODNR"];
            dwData["AMEEINSTNR"] = (string)pm["EINSTNR"];
            dwData["AMEBDEKEN"] = (string)pm["BDEKEN"];

            dwData["AMEBEZ"] = ((string)pm["BDEKEN"]).PadRight(40);
            dwData["AMEKBEZ"] = ((string)pm["BDEKEN"]).PadRight(10);
            dwData["AMEWERTNR"] = ((string)pm["BDEKEN"]).Substring(5,3); 
            Insert(dwData);
        }
        public void Insert(DataRow _dwAPK)
        {
            InsertAMEINST(_dwAPK, app.company);
            TBMain.Rows.InsertAt(_dwAPK, 0);
        }
    }
    public partial class VAMEINST
    {
        public string AMENRKRS { get { if (dwMaster == null) return ""; return dwMaster["AMENRKRS"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMENRKRS"] = value; OnPropertyChanged("AMENRKRS", value); } } //lENGth 2
        public string AMELFDNR { get { if (dwMaster == null) return ""; return dwMaster["AMELFDNR"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMELFDNR"] = value; OnPropertyChanged("AMELFDNR", value); } } //lENGth 4
        public string AMEPOS { get { if (dwMaster == null) return ""; return dwMaster["AMEPOS"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMEPOS"] = value; OnPropertyChanged("AMEPOS", value); } } //lENGth 2
        public string AMEMODNR { get { if (dwMaster == null) return ""; return dwMaster["AMEMODNR"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMEMODNR"] = value; OnPropertyChanged("AMEMODNR", value); } } //lENGth 3
        public string AMEEINSTNR { get { if (dwMaster == null) return ""; return dwMaster["AMEEINSTNR"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMEEINSTNR"] = value; OnPropertyChanged("AMEEINSTNR", value); } } //lENGth 3
        public string AMEBEZ { get { if (dwMaster == null) return ""; return dwMaster["AMEBEZ"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMEBEZ"] = value; OnPropertyChanged("AMEBEZ", value); } } //lENGth 40
        public string AMEKBEZ { get { if (dwMaster == null) return ""; return dwMaster["AMEKBEZ"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMEKBEZ"] = value; OnPropertyChanged("AMEKBEZ", value); } } //lENGth 10
        public string AMEPROGKZ { get { if (dwMaster == null) return ""; return dwMaster["AMEPROGKZ"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMEPROGKZ"] = value; OnPropertyChanged("AMEPROGKZ", value); } } //lENGth 1
        public string AMEBDEKEN { get { if (dwMaster == null) return ""; return dwMaster["AMEBDEKEN"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMEBDEKEN"] = value; OnPropertyChanged("AMEBDEKEN", value); } } //lENGth 8
        public string AMEWERTVON { get { if (dwMaster == null) return ""; return dwMaster["AMEWERTVON"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMEWERTVON"] = value; OnPropertyChanged("AMEWERTVON", value); } } //lENGth 16
        public string AMEWERTVONN { get { if (dwMaster == null) return ""; return dwMaster["AMEWERTVONN"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMEWERTVONN"] = value; OnPropertyChanged("AMEWERTVONN", value); } } //lENGth 16
        public string AMEWERTBIS { get { if (dwMaster == null) return ""; return dwMaster["AMEWERTBIS"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMEWERTBIS"] = value; OnPropertyChanged("AMEWERTBIS", value); } } //lENGth 16
        public string AMEWERTBISN { get { if (dwMaster == null) return ""; return dwMaster["AMEWERTBISN"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMEWERTBISN"] = value; OnPropertyChanged("AMEWERTBISN", value); } } //lENGth 16
        public string AMEMASS { get { if (dwMaster == null) return ""; return dwMaster["AMEMASS"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMEMASS"] = value; OnPropertyChanged("AMEMASS", value); } } //lENGth 20
        public string AMEWERTEX1 { get { if (dwMaster == null) return ""; return dwMaster["AMEWERTEX1"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMEWERTEX1"] = value; OnPropertyChanged("AMEWERTEX1", value); } } //lENGth 16
        public string AMEWERTEX2 { get { if (dwMaster == null) return ""; return dwMaster["AMEWERTEX2"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMEWERTEX2"] = value; OnPropertyChanged("AMEWERTEX2", value); } } //lENGth 16
        public string AMEWERTEX3 { get { if (dwMaster == null) return ""; return dwMaster["AMEWERTEX3"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMEWERTEX3"] = value; OnPropertyChanged("AMEWERTEX3", value); } } //lENGth 16
        public string AMEWERTEX4 { get { if (dwMaster == null) return ""; return dwMaster["AMEWERTEX4"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMEWERTEX4"] = value; OnPropertyChanged("AMEWERTEX4", value); } } //lENGth 16
        public string AMEMESCHL { get { if (dwMaster == null) return ""; return dwMaster["AMEMESCHL"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMEMESCHL"] = value; OnPropertyChanged("AMEMESCHL", value); } } //lENGth 2
        public double AMEINTERVAL { get { if (dwMaster == null) return 0.0; return Convert.ToDouble(dwMaster["AMEINTERVAL"].ToString()); } set { if (dwMaster == null) return; dwMaster["AMEINTERVAL"] = value; OnPropertyChanged("AMEINTERVAL", value); } } //lENGth 0
        public double AMEWERTNR { get { if (dwMaster == null) return 0.0; return Convert.ToDouble(dwMaster["AMEWERTNR"].ToString()); } set { if (dwMaster == null) return; dwMaster["AMEWERTNR"] = value; OnPropertyChanged("AMEWERTNR", value); } } //lENGth 0

        #region======ColumnSchema==========
        /*
                 public string AMEMANDANT { get { if (dwMaster == null) return ""; return dwMaster["AMEMANDANT"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMEMANDANT"] = value; OnPropertyChanged("AMEMANDANT", value); } } //lENGth 2
                 public string AMEEAKZ { get { if (dwMaster == null) return ""; return dwMaster["AMEEAKZ"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMEEAKZ"] = value; OnPropertyChanged("AMEEAKZ", value); } } //lENGth 1
                 public string AMEWERKKZ { get { if (dwMaster == null) return ""; return dwMaster["AMEWERKKZ"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMEWERKKZ"] = value; OnPropertyChanged("AMEWERKKZ", value); } } //lENGth 1
                 public string AMEPFLKZ { get { if (dwMaster == null) return ""; return dwMaster["AMEPFLKZ"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMEPFLKZ"] = value; OnPropertyChanged("AMEPFLKZ", value); } } //lENGth 1
                 public string AMERICHTKZ { get { if (dwMaster == null) return ""; return dwMaster["AMERICHTKZ"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMERICHTKZ"] = value; OnPropertyChanged("AMERICHTKZ", value); } } //lENGth 1
                 
                 public string AMEMESSGR { get { if (dwMaster == null) return ""; return dwMaster["AMEMESSGR"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMEMESSGR"] = value; OnPropertyChanged("AMEMESSGR", value); } } //lENGth 20
                 public string AMEFDLG { get { if (dwMaster == null) return ""; return dwMaster["AMEFDLG"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMEFDLG"] = value; OnPropertyChanged("AMEFDLG", value); } } //lENGth 2
                 public string AMEFDNUM { get { if (dwMaster == null) return ""; return dwMaster["AMEFDNUM"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMEFDNUM"] = value; OnPropertyChanged("AMEFDNUM", value); } } //lENGth 1
                 public string AMEFDNKST { get { if (dwMaster == null) return ""; return dwMaster["AMEFDNKST"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMEFDNKST"] = value; OnPropertyChanged("AMEFDNKST", value); } } //lENGth 1
                 public string AMEDRUCKKZ { get { if (dwMaster == null) return ""; return dwMaster["AMEDRUCKKZ"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMEDRUCKKZ"] = value; OnPropertyChanged("AMEDRUCKKZ", value); } } //lENGth 1
                 public string AMERUEKZ { get { if (dwMaster == null) return ""; return dwMaster["AMERUEKZ"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMERUEKZ"] = value; OnPropertyChanged("AMERUEKZ", value); } } //lENGth 1
                 
                 
                 public string AMEWERTEXN1 { get { if (dwMaster == null) return ""; return dwMaster["AMEWERTEXN1"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMEWERTEXN1"] = value; OnPropertyChanged("AMEWERTEXN1", value); } } //lENGth 16
                 public string AMEWERTEXN2 { get { if (dwMaster == null) return ""; return dwMaster["AMEWERTEXN2"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMEWERTEXN2"] = value; OnPropertyChanged("AMEWERTEXN2", value); } } //lENGth 16
                 public string AMEWERTEXN3 { get { if (dwMaster == null) return ""; return dwMaster["AMEWERTEXN3"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMEWERTEXN3"] = value; OnPropertyChanged("AMEWERTEXN3", value); } } //lENGth 16
                 public string AMEWERTEXN4 { get { if (dwMaster == null) return ""; return dwMaster["AMEWERTEXN4"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMEWERTEXN4"] = value; OnPropertyChanged("AMEWERTEXN4", value); } } //lENGth 16
                 public double AMESCHWWERT { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["AMESCHWWERT"].ToString()); } set { if (dwMaster == null) return; dwMaster["AMESCHWWERT"] = value; OnPropertyChanged("AMESCHWWERT", value); } } //lENGth 0
                 public string AMESCHWWERTP { get { if (dwMaster == null) return ""; return dwMaster["AMESCHWWERTP"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMESCHWWERTP"] = value; OnPropertyChanged("AMESCHWWERTP", value); } } //lENGth 1
                 public double AMETOLMIN { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["AMETOLMIN"].ToString()); } set { if (dwMaster == null) return; dwMaster["AMETOLMIN"] = value; OnPropertyChanged("AMETOLMIN", value); } } //lENGth 0
                 public double AMETOLPLU { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["AMETOLPLU"].ToString()); } set { if (dwMaster == null) return; dwMaster["AMETOLPLU"] = value; OnPropertyChanged("AMETOLPLU", value); } } //lENGth 0
                 public string AMETOLP { get { if (dwMaster == null) return ""; return dwMaster["AMETOLP"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMETOLP"] = value; OnPropertyChanged("AMETOLP", value); } } //lENGth 1
                 public double AMELISTWERT { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["AMELISTWERT"].ToString()); } set { if (dwMaster == null) return; dwMaster["AMELISTWERT"] = value; OnPropertyChanged("AMELISTWERT", value); } } //lENGth 0
                 public string AMELEITWEG { get { if (dwMaster == null) return ""; return dwMaster["AMELEITWEG"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMELEITWEG"] = value; OnPropertyChanged("AMELEITWEG", value); } } //lENGth 10
                 public string AMESTOPPEN { get { if (dwMaster == null) return ""; return dwMaster["AMESTOPPEN"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMESTOPPEN"] = value; OnPropertyChanged("AMESTOPPEN", value); } } //lENGth 2
                 public string AMELAUFKRS { get { if (dwMaster == null) return ""; return dwMaster["AMELAUFKRS"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMELAUFKRS"] = value; OnPropertyChanged("AMELAUFKRS", value); } } //lENGth 2
                 public string AMELAUFLFD { get { if (dwMaster == null) return ""; return dwMaster["AMELAUFLFD"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMELAUFLFD"] = value; OnPropertyChanged("AMELAUFLFD", value); } } //lENGth 6
                 public string AMELAUFPOS { get { if (dwMaster == null) return ""; return dwMaster["AMELAUFPOS"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMELAUFPOS"] = value; OnPropertyChanged("AMELAUFPOS", value); } } //lENGth 3
                 public string AMEEINLEGKZ { get { if (dwMaster == null) return ""; return dwMaster["AMEEINLEGKZ"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMEEINLEGKZ"] = value; OnPropertyChanged("AMEEINLEGKZ", value); } } //lENGth 1
                 public string AMESTSA { get { if (dwMaster == null) return ""; return dwMaster["AMESTSA"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMESTSA"] = value; OnPropertyChanged("AMESTSA", value); } } //lENGth 3
                 public string AMEEINPOS { get { if (dwMaster == null) return ""; return dwMaster["AMEEINPOS"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMEEINPOS"] = value; OnPropertyChanged("AMEEINPOS", value); } } //lENGth 2
                 public string AMEAUFM { get { if (dwMaster == null) return ""; return dwMaster["AMEAUFM"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMEAUFM"] = value; OnPropertyChanged("AMEAUFM", value); } } //lENGth 2
                 public string AMEKOSTRE { get { if (dwMaster == null) return ""; return dwMaster["AMEKOSTRE"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMEKOSTRE"] = value; OnPropertyChanged("AMEKOSTRE", value); } } //lENGth 1
                 public string AMEFILLER { get { if (dwMaster == null) return ""; return dwMaster["AMEFILLER"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMEFILLER"] = value; OnPropertyChanged("AMEFILLER", value); } } //lENGth 55
                 public double AMEAENDZL { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["AMEAENDZL"].ToString()); } set { if (dwMaster == null) return; dwMaster["AMEAENDZL"] = value; OnPropertyChanged("AMEAENDZL", value); } } //lENGth 0
                 public string AMEAENDBEN { get { if (dwMaster == null) return ""; return dwMaster["AMEAENDBEN"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMEAENDBEN"] = value; OnPropertyChanged("AMEAENDBEN", value); } } //lENGth 8
                 public double AMEAENDDAT { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["AMEAENDDAT"].ToString()); } set { if (dwMaster == null) return; dwMaster["AMEAENDDAT"] = value; OnPropertyChanged("AMEAENDDAT", value); } } //lENGth 0
                 public string AMENEUBEN { get { if (dwMaster == null) return ""; return dwMaster["AMENEUBEN"].ToString(); } set { if (dwMaster == null) return; dwMaster["AMENEUBEN"] = value; OnPropertyChanged("AMENEUBEN", value); } } //lENGth 8
                 public double AMENEUDAT { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["AMENEUDAT"].ToString()); } set { if (dwMaster == null) return; dwMaster["AMENEUDAT"] = value; OnPropertyChanged("AMENEUDAT", value); } } //lENGth 0
        */
        #endregion
    }
}

